<!DOCTYPE html>
<html>
#{include file="header.html"}#
<body class="gray-bg">
<div class="ibox-content">
    <form class="form-horizontal" method="post" action="#{$smarty.const.ACT}#/crm/CstLinkmanExport/cst_linkman_export_cvs/">
      <div class="form-group text-left" >
        <label class="col-sm-2 control-label">创建人</label>
 			<div class="col-sm-10">
          <select data-placeholder="选择创建人..." name="create_user_id" class="chosen-select sys_user-chosen-select" style="width: 200px;" tabindex="2">
            	<option value="">所有创建人</option>
						#{foreach from=$sys_user key=k item=v}#	  
						<option value="#{$v.id}#" hassubinfo="true">#{$v.name}#</option>
						#{/foreach}#
          </select>
        </div>
      </div>
      <div class="form-group text-left pd-b-5">
        <label class="col-sm-2 control-label">归属人</label>
        <div class="col-sm-10">
          <select data-placeholder="选择归属人..." name="owner_user_id" class="chosen-select sys_user-chosen-select" style="width: 200px;" tabindex="2">
            	<option value="">所有归属人</option>
						#{foreach from=$sys_user key=k item=v}#	  
						<option value="#{$v.id}#" hassubinfo="true">#{$v.name}#</option>
						#{/foreach}#
          </select>
        </div>
      </div>
      <div class="form-group">
        <div class="col-sm-offset-2 col-sm-8">
          <button class="btn btn-w-m btn-info" type="submit">确认导出数据</button>
        </div>
      </div>
    </form>
  </div>
<!-- 自定义js --> 
<script src="#{$smarty.const.APP}#/View/template/js/content.js?v=1.0.0"></script> 
<script>
$(document).ready(function () {
	$(".datepicker").datepicker({
		language: "zh-CN",
		autoclose: true,//选中之后自动隐藏日期选择框
		clearBtn: true,//清除按钮
		todayBtn: true,//今日按钮
		format: "yyyy-mm-dd",
	});
	$(".datetimepicker").datetimepicker({
		language: "zh-CN",
		autoclose: true,//选中之后自动隐藏日期选择框
		clearBtn: true,//清除按钮
		todayBtn: true,//今日按钮
		format: "yyyy-mm-dd hh:ii:ss",
	});
	$('.i-checks').iCheck({
		checkboxClass: 'icheckbox_square-green',
		radioClass: 'iradio_square-green',
	});	
	//下拉选择+联动效果
	$('.chosen-select').chosen({search_contains: true});
	$(".customer-chosen-select").val("#{$customer_id}#").trigger("chosen:updated");

	//数据保存
	$("body").on("click", ".save-form", function() {
		FormData=$("form").serialize();
		$.ajax({
			type: "POST",
			url: "#{$smarty.const.ACT}#/crm/CstLinkmanExport/cst_linkman_export_cvs/",
			data:FormData,
			dataType:"json",
			success: function(data){
				if(data.statusCode=='200'){
					layer.msg('操作成功', {icon: 1}); 		
				}
			},    
			complete: function() {   
				setTimeout(function(){
					//关闭窗口
					var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
					parent.layer.close(index);
				 },800);
   		  },
		});		
	});
});
</script>
</body>
</html>